package com.giao.service;

import com.giao.mapper.jExtCproductMapper;
import com.giao.pojo.ExtCproductC;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class jExtCproductServiceImpl implements jExtCproductService {
    @Autowired
    private jExtCproductMapper jExtCproductMapper;

    @Override
    public List<ExtCproductC> findAllExtCproductC() {
        return jExtCproductMapper.findAllExtCproductC();
    }

    @Override
    public int insertExtCproductC(ExtCproductC extCproductC) {
        extCproductC.setAmount(extCproductC.getPrice() * extCproductC.getCnumber());
        return jExtCproductMapper.insertExtCproductC(extCproductC);

    }

    @Override
    public int deleteExtCproductC(int ext_Cproduct_id) {
        return jExtCproductMapper.deleteExtCproductC(ext_Cproduct_id);
    }

    @Override
    public ExtCproductC findByExtCproductCId(int ext_Cproduct_id) {
        return jExtCproductMapper.findByExtCproductCId(ext_Cproduct_id);
    }

    @Override
    public int updateExtCproductC(ExtCproductC extCproductC) {
        return jExtCproductMapper.updateExtCproductC(extCproductC);
    }
}
